<template>
    <div class="install-step">
        <i></i>
        <button class="reset" type="button" @click="OnChanged">
            <img :src="state ? `/static/Lidar/ic_zhankai.png` : `/static/Lidar/ic_shouqi.png`">
            <span>安装步骤</span>
        </button>
        <div class="list-view-container">
            <div class="list-view">
                <span v-for="description of InstallComponent.Default.StepDescriptions.value" :key="description.name"
                :class="description.type ? 'stepListTrue' : 'stepListFalse'">
                    {{ description.name }}
                </span>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { InstallComponent } from './LidarComponent';
import ModalComponent from '@runtime/module/Modal/ModalComponent';
const state = ref(true);

const sidebarTranslateX = ref('translateX(0)');
const buttonTranslateX = ref('translateX(0)');

function OnChanged() {
    state.value = !state.value;
    sidebarTranslateX.value = state.value ? 'translateX(0)' : 'translateX(100%)';
    buttonTranslateX.value = state.value ? 'translateX(0)' : 'translateX(-6rem)';
}
</script>

<style scoped>
::-webkit-scrollbar {
    width: 0.4rem;
    height: 0.4rem;
}

::-webkit-scrollbar-thumb {
    background: rgba(129, 133, 156, 0.3);
    border-radius: 0.2rem;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 133, 156, 0.5);
}

::-webkit-scrollbar-track {
    border-radius: 0.2rem;
    background-color: rgba(129, 133, 156, 0.1);
}

.list-view-container {
    max-height: 30rem;
    overflow-y: overlay;
}

.list-view {
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    gap: 1rem;
}

.install-step {
    position: absolute;
    right: 0;
    top: 32rem;

    display: flex;
    flex-direction: column;
    justify-content: stretch;
    gap: 1rem;

    padding-bottom: 1rem;

    background-color: #131620;

    border-radius: 2rem 0 0 2rem;

    transform: v-bind(sidebarTranslateX);

    transition: transform 300ms;
}

button {
    width: 100%;
    height: 5rem;

    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.4rem;

    padding-left: 2.4rem !important;
    padding-right: 2.4rem !important;

    background-color: #131620 !important;

    border-radius: 2.5rem 0 0 2.5rem;
    box-shadow: inset 0 -0.1rem 0 0 #1F1F2D;

    transform: v-bind(buttonTranslateX);

    transition: transform 300ms;

    cursor: pointer;
}

button>span:first-of-type {
    color: #B1B1D4;
    font-size: 1.8rem;
    font-weight: 500;
}

i {
    position: absolute;
    left: 0;
    bottom: 0;

    display: block;
    width: 100%;
    height: calc(100% - 6rem);

    border-left: solid 0.6rem transparent;
    border-bottom: solid 0.6rem transparent;
    border-radius: 0 0 0 2rem;
    background-image: linear-gradient(#131620, #131620),
        linear-gradient(90deg, #218cde, #807de1);
    background-origin: border-box;
    background-clip: content-box, border-box;

    z-index: -1;
}

/* .list-view>span {
    display: block;

    height: 4.4rem;

    padding-left: 2rem;
    padding-right: 2rem;

    color: #81859C;
    font-size: 1.6rem;
    font-weight: 500;
    text-align: right;
    line-height: 4.4rem;
} */
.stepListTrue {
    display: block;

height: 4.4rem;

padding-left: 2rem;
padding-right: 2rem;

color: #11a8cd;
font-size: 1.6rem;
font-weight: 500;
text-align: right;
line-height: 4.4rem;
}
.stepListFalse {
    display: block;

height: 4.4rem;

padding-left: 2rem;
padding-right: 2rem;

color: #81859C;
font-size: 1.6rem;
font-weight: 500;
text-align: right;
line-height: 4.4rem;
}
</style>./LidarComponent